package com.bys.admin.ai.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Objects;

import com.bys.config.BaseEntity;
import com.bys.constant.CommonConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * AI API 秘钥 DO
 * </p>
 *
 * @author bys
 * @since 2025-02-19
 */
@Getter
@Setter
@TableName("ai_api_key")
@Schema(name = "AiApiKey对象", description = "AI API 秘钥 DO")
public class AiApiKey  extends BaseEntity {


    @Schema( description = "名称")
    private String name;

    @Schema(description = "密钥")
    private String apiKey;

    @Schema(description = "平台")
    private String platform;

    @Schema(description = "API 地址")
    private String url;

    @Schema(description = "状态")
    private Integer status;

    public Integer getStatus() {
        if(Objects.isNull(this.status)){
            return CommonConstant.ENABLE_STATUS;
        }
        return status;
    }
}
